class Text(object):
    __slots__ = ('_name', 'age')

    def __init__(self, name, age):
        self._name = name
        self._age = age

    @property
    def name(self):
        return self._name

    @property
    def age(self):
        return self._age

    @property
    def alive(self):
        return self._age > 18

    @age.setter
    def age(self, age):
        self._age = age if age > 18 else 0

    def text(self):
        print('%s 正在学习' % self._name)


s = Text('sf')
s.text()

